
import { defineStore } from 'pinia'
import {ref} from "vue"

export const useBaseStore = defineStore('base', {
     // 数据存到store里刷新页面会重置，持久化就不会了
     persist: {
      enabled: true, //开启数据持久化
      strategies: [
        {
          key: "base", //给一个要保存的名称
          storage: localStorage, //sessionStorage / localStorage 存储方式
        },
      ],
    },
    state: () => ({ 
        routerlist : ref([]),
        qiniuToken : "",
        limittime : "7200" 
     }),
    getters: {
        getRouterList: (state) => state.routerlist,
    },
    actions: {
      addrouter(routername) {
        state.routerlist.push(routername);
      },
    },

})